package controllers

import (
	"cashew.com/cashew_api/dtos"
	"cashew.com/cashew_api/services"
	"cashew.com/cashew_common/constants"
)

type RegionController struct {
	BaseController
}

func (c *RegionController) GetSubRegionList() {

	// 获取子区域列表
	subRegionList, err := services.GetSubRegionList()

	if err != nil || subRegionList == nil {
		c.Error("获取子区域列表失败:", err)
		c.Result(constants.ERR_SYS, nil)
		return
	}

	c.Result(constants.SUCCESS, &dtos.RegionGetSubRegionListResult{
		Items: subRegionList,
	})
}
